<?php
namespace app\home\controller;

use app\common\controller\HomeBase;  // model
use think\Db;                       // db
use app\common\model\Article as ArticleModel;

class Index extends HomeBase
{

    /*
    *
    * */
    public function index()
    {
        // 1 获取当前域名
        $current_url = $_SERVER['SERVER_NAME'];
//        echo $_SERVER['SERVER_NAME'];
        $this->assign('current_url',$_SERVER['SERVER_NAME']);
        return $this->fetch();
    }


    /*
     * 跳转首页测试多域名切换跳转
     * */
    public function index_bk()
    {

        $article = new ArticleModel();
        $result = $article->showAllArticles();
        dump($result);
        exit;

        $title_array = array(
            'title'     => '首页'       ,
            'id'     => 1
        );
        $this->assign('title',$title_array);
        return $this->fetch();
    }






}
